<?php
namespace Bpm\Controllers;


use Helpers\Controller;
use Helpers\Main;



class ControllerBase extends Controller
{


    public function praseLog($detail,$msg)
    {
        return Main::createCommitLog(
            'bpm',
            $this->dispatcher->getControllerName(),
            $this->dispatcher->getActionName(),
            ['post' => $this->request->getPost(), 'get' => $this->request->getQuery(), 'detail' => $detail],
            null,
            $msg
        );
    }

    public function beforeExecuteRoute($dispatcher)
    {
        if (in_array(strtolower($this->dispatcher->getActionName()),[
            'getplan',
            'transform'
        ] )){
            return true;
        }

        $userId=Main::getLoginUserInfo('userId');
        if(!$userId){
            Main::goLoginPage();
        }
    }


}
